#include<stdio.h>
#include<stdlib.h>
void Quicksort(int left,int right,int* a){
	if(left>=right) return;
	else{int t;
		int i=left;
		int j=right;
		int min=(left+right)/2;
		int k=a[min]; 
	while(i<=j){
		while(a[j]>k){
			j--;
		}while(a[i]<k){
			i++;
		}if(i<=j){
			t=a[j];
			a[j]=a[i];
			a[i]=t;
			i++;
			j--;
		}
	} if(j>=left)Quicksort(left,j,a);
	if(right>=i)Quicksort(i,right,a);
	}
} 
int main(){
	int a[7]={2,9,10,4,3,8,5};
	Quicksort(0,6,a);
	for(int i=0;i<7;i++){
	printf("%d ",a[i]);            
}}
